Optimal. Leaf size=51 \[ \frac {e x}{a}+\frac {f x^2}{2 a}+\frac {(e+f x) \cos (c+d x)}{a d}-\frac {f \sin (c+d x)}{a d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {4619, 3377,
2717} \begin {gather*} -\frac {f \sin (c+d x)}{a d^2}+\frac {(e+f x) \cos (c+d x)}{a d}+\frac {e x}{a}+\frac {f x^2}{2 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 3377
Rule 4619
Rubi steps
\begin {align*} \int \frac {(e+f x) \cos ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac {\int (e+f x) \, dx}{a}-\frac {\int (e+f x) \sin (c+d x) \, dx}{a}\\ &=\frac {e x}{a}+\frac {f x^2}{2 a}+\frac {(e+f x) \cos (c+d x)}{a d}-\frac {f \int \cos (c+d x) \, dx}{a d}\\ &=\frac {e x}{a}+\frac {f x^2}{2 a}+\frac {(e+f x) \cos (c+d x)}{a d}-\frac {f \sin (c+d x)}{a d^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.29, size = 53, normalized size = 1.04 \begin {gather*} -\frac {(c+d x) (-2 d e+c f-d f x)-2 d (e+f x) \cos (c+d x)+2 f \sin (c+d x)}{2 a d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 78, normalized size = 1.53
method | result | size |
risch | \(\frac {e x}{a}+\frac {f \,x^{2}}{2 a}+\frac {\left (f x +e \right ) \cos \left (d x +c \right )}{a d}-\frac {f \sin \left (d x +c \right )}{a \,d^{2}}\) | \(50\) |
derivativedivides | \(\frac {-f c \cos \left (d x +c \right )+e d \cos \left (d x +c \right )-f \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )-f c \left (d x +c \right )+e d \left (d x +c \right )+\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(78\) |
default | \(\frac {-f c \cos \left (d x +c \right )+e d \cos \left (d x +c \right )-f \left (\sin \left (d x +c \right )-\left (d x +c \right ) \cos \left (d x +c \right )\right )-f c \left (d x +c \right )+e d \left (d x +c \right )+\frac {f \left (d x +c \right )^{2}}{2}}{d^{2} a}\) | \(78\) |
norman | \(\frac {\frac {2 e}{d a}+\frac {f \,x^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {f \,x^{2} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {\left (d e +f \right ) x}{d a}-\frac {2 f \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a \,d^{2}}+\frac {\left (2 d e -2 f \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a \,d^{2}}+\frac {\left (d e -f \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}+\frac {\left (d e -f \right ) x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}+\frac {\left (d e +f \right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}+\frac {f \,x^{2}}{2 a}+\frac {2 e x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {2 e x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {f \,x^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a}+\frac {f \,x^{2} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {f \,x^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a}+\frac {2 \left (d e -f \right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a \,d^{2}}+\frac {2 \left (d e -f \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a \,d^{2}}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}\) | \(364\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 151 vs.
\(2 (49) = 98\).
time = 0.49, size = 151, normalized size = 2.96 \begin {gather*} -\frac {4 \, c f {\left (\frac {1}{a d + \frac {a d \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a d}\right )} - 4 \, e {\left (\frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}\right )} - \frac {{\left ({\left (d x + c\right )}^{2} + 2 \, {\left (d x + c\right )} \cos \left (d x + c\right ) - 2 \, \sin \left (d x + c\right )\right )} f}{a d}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 51, normalized size = 1.00 \begin {gather*} \frac {d^{2} f x^{2} + 2 \, d^{2} x e + 2 \, {\left (d f x + d e\right )} \cos \left (d x + c\right ) - 2 \, f \sin \left (d x + c\right )}{2 \, a d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 326 vs.
\(2 (41) = 82\).
time = 1.62, size = 326, normalized size = 6.39 \begin {gather*} \begin {cases} \frac {2 d^{2} e x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {2 d^{2} e x}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {d^{2} f x^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {d^{2} f x^{2}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {4 d e}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} - \frac {2 d f x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} + \frac {2 d f x}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} - \frac {4 f \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a d^{2} \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 2 a d^{2}} & \text {for}\: d \neq 0 \\\frac {\left (e x + \frac {f x^{2}}{2}\right ) \cos ^{2}{\left (c \right )}}{a \sin {\left (c \right )} + a} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 13408 vs.
\(2 (51) = 102\).
time = 4.41, size = 13408, normalized size = 262.90 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.94, size = 53, normalized size = 1.04 \begin {gather*} \frac {\frac {f\,x^2}{2}+e\,x}{a}-\frac {f\,\sin \left (c+d\,x\right )-d\,\left (e\,\cos \left (c+d\,x\right )+f\,x\,\cos \left (c+d\,x\right )\right )}{a\,d^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________